package com.ojoin.trade.common_core.web.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ojoin.trade.common.exception.BusinessException;
import com.ojoin.trade.common.web.service.BaseService;
import com.ojoin.trade.common_core.web.domain.MerchantUserInfo;
import com.ojoin.trade.common_core.web.domain.TbMerchantUser;
import com.ojoin.trade.common_core.web.domain.TbMerchantUserBusinessType;

public interface MerchantUserBaseService extends BaseService<TbMerchantUser> {

	/**
	 * 九盈用户登陆(JA000001)
	 * 
	 * @param username
	 * @param password
	 * @return
	 * @throws BusinessException
	 */
	public List login(String username, String password)
			throws BusinessException;

	/**
	 * 注册九盈用户(JA000002) 返回九盈用户id
	 * @param mthNo
	 * @param userAccount
	 * @return
	 * @throws BusinessException
	 */
	public int registerJoinUser(String mthNo, String userAccount) throws BusinessException;

	/**
	 * 查询九盈用户对应支付用户信息(JA000003)
	 * 
	 * @param joinuserNo
	 * @return
	 * @throws BusinessException
	 */
	public String queryPayUserByJoinUserID(int joinuserNo)
			throws BusinessException;

	/**
	 * 查询支付商户详细信息(JA000004)
	 * 
	 * @param mthNo
	 * @return
	 * @throws BusinessException
	 */
	public List queryPayUserVOByID(String mthNo) throws BusinessException;

	/**
	 * 预实名认证
	 * 
	 * @param mchNo
	 * @return
	 * @throws BusinessException
	 */
	public List preRealNameByPayUser(String mchNo) throws BusinessException;

	/**
	 * 企业实名认证
	 * 
	 * @param mchNo
	 * @param mchName
	 * @param mobile
	 * @param name
	 * @param certNo
	 * @param licNo
	 * @param taxNo
	 * @param certDate
	 * @param openNo
	 * @param orgNo
	 * @param cardMobile
	 * @param cardNo
	 * @param cardProvince
	 * @param cardCity
	 * @param branchNo
	 * @return
	 * @throws BusinessException
	 */
	public List realNameEnterpriseByPayUserInfo(String mchNo,
			String mchName, String mobile, String name, String certNo,
			String licNo, String taxNo, String certDate, String openNo,
			String orgNo, String cardMobile, String cardNo,
			String cardProvince, String cardCity, String branchNo)
			throws BusinessException;

	/**
	 * 个人实名认证
	 * 
	 * @param mchNo
	 * @param name
	 * @param certNo
	 * @param certDate
	 * @param cardMobile
	 * @param cardNo
	 * @param cardProvince
	 * @param cardCity
	 * @param branchNo
	 * @return
	 * @throws BusinessException
	 */
	public List realNameIndividualByPayUserInfo(String mchNo,String mchName, String mobile,
			String name, String certNo, String certDate, String cardMobile,
			String cardNo, String cardProvince, String cardCity, String branchNo)
			throws BusinessException;

	/**
	 * 修改登陆密码
	 * 
	 * @param mchNo
	 * @param oldPasswd
	 * @param newPasswd
	 * @return
	 * @throws BusinessException
	 */
	public List updateLoginPwd(String mchNo, String oldPasswd, String newPasswd)
			throws BusinessException;

	/**
	 * 修改支付密码
	 * 
	 * @param mchNo
	 * @param oldPasswd
	 * @param newPasswd
	 * @return
	 * @throws BusinessException
	 */
	public List updatePayPwd(String mchNo, String oldPasswd, String newPasswd)
			throws BusinessException;

	/**
	 * 设置支付密码
	 * 
	 * @param mchNo
	 * @param newPasswd
	 * @return
	 * @throws BusinessException
	 */
	public List setPayPwd(String mchNo, String newPasswd)
			throws BusinessException;

	/**
	 * 根据join的用户查询join用户表的信息
	 * 
	 * @param joinuserNo
	 * @return
	 * @throws BusinessException
	 */
	public TbMerchantUser queryJoinUserInfoById(int joinuserNo)
			throws BusinessException;

	/**
	 * 
	 * @param mchno
	 * @return
	 * @throws BusinessException
	 */
	public TbMerchantUser queryJoinUser(String mchno) throws BusinessException;
	
	
	public String queryJoinUserByLoginNo(String loginNo) throws BusinessException;

	public int updateUserBalanceAfterTransfer(int joinuserNo, long radio,
			long fee, long balance, String operatetype) throws BusinessException;

	/**
	 * 查询指定表中指定id对应的row_update_time字段值
	 * @param id
	 * @param tablename
	 * @return
	 * @throws BusinessException
	 */
	public String selectTsByID(int id, String tablename) throws BusinessException;

    /**
     * 根据保理公司查询公司对应的商户信息
     * @param id
     * @return
     * @throws BusinessException
     */

	public TbMerchantUser queryUserByCompany(int id)throws BusinessException;

	
	/**
	 * 查询指定九盈用户已申请的业务类型及各贷款业务负债额
	 * 0  未开通
	 * 1  已开通
	 * 
	 * @param joinuserid
	 * @return
	 * @throws BusinessException
	 */
	public TbMerchantUserBusinessType queryBusinessTypeByJoinuserId(int joinuserid) throws BusinessException;


	/**
	 * 更新九盈用户简称
	 * @param joinuserid
	 * @param shortname
	 * @return
	 * @throws BusinessException
	 */
	public int updateShortnameById(int joinuserid, String shortname) throws BusinessException;
	
	/**
	 * 查询商户在九盈是否存在负债
	 * @param param
	 * @return
	 * @throws BusinessException
	 */
	public boolean isExistsDebtByMhtno(Map param) throws BusinessException;
	
}